<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>使用JavaScript访问HTML元素</title>
</head>

<body>
    <p id="Demo">段落 1。</p>
    <p id="demo">段落 2。</p>
    <script>
        //只有段落2会被替换
        document.getElementById("demo").innerHTML = "HELLO.";
    </script>
</body>

</html>